class Todo(object):
    current_id = 1

    @classmethod
    def next_id(cls):
        todo_id = Todo.current_id
        Todo.current_id += 1
        return todo_id

    def __init__(self,title:str,id:int=0,completed=False):
        self.id = id if id>0 else Todo.next_id()
        self.title = title
        self.completed = completed


